package main

func main()  {
	println(twoSum([]int{2,7,11,15},9))
}

func twoSum(nums []int, target int) []int {
	set := map[int]int{}
	res := []int{0,0}
	for i,v :=range nums{
		if set[target-v] !=0{
			return []int{set[target-v]-1,i}
		}
		set[target-v]=i+1
	}
	return res
}